<?php

namespace Database\Seeders;

use App\Kuafu\Brand\Model\Brand;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class BrandSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $insertArr = [
            [
                'id'        => 10,
                'name'      => '夸父炸串',
                'imageUrl'  => 'https://www.51kuafu.com/file/storage/image/202101221113498a86f7071.jpg',
                'status'    => 0,
                'isDeleted' => 0,
                'createdAt' => time(),
                'updatedAt' => time()
            ],
            [
                'id'        => 11,
                'name'      => '大炸院',
                'imageUrl'  => 'https://img.meituan.net/msmerchant/2a616d5fdc8d923ca746bb8c2a12eff92016841.jpg%40340w_255h_1e_1c_1l%7Cwatermark%3D0',
                'status'    => 0,
                'isDeleted' => 0,
                'createdAt' => time(),
                'updatedAt' => time()
            ],
            [
                'id'        => 12,
                'name'      => '心有炸念',
                'imageUrl'  => 'https://www.zuizhifu.com/uploads/picture/20191030/LBjJ1DQma3cgjmteuVUhIb5ntucO9sBruWPxyukD.jpeg',
                'status'    => 0,
                'isDeleted' => 0,
                'createdAt' => time(),
                'updatedAt' => time()
            ],
        ];

        $table = Brand::query()->getModel()->getTable();
        DB::table($table)->whereIn('id', [10, 11, 12])->delete();
        DB::table($table)->insert($insertArr);
    }
}
